//
//  FirstViewController.swift
//  TC_V1
//
//  Created by Casper Ng on 16/6/17.
//  Copyright © 2017 Casper Ng. All rights reserved.
//

import UIKit

class FirstViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource {

    var imageArroy = [UIImage(named:"pers_tc"),UIImage(named:"pers_bbt"),UIImage(named:"pers_gym"),UIImage(named:"pers_read"),UIImage(named:"pers_brew"),]
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return imageArroy.count
    }
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "PersCollectionViewCell", for: indexPath) as! PersCollectionViewCell
        
        cell.imgImage.image = imageArroy[indexPath.row]
        
        return cell
    }
    /*func collectiveView(_collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "PersCollectionViewCell", for: indexPath) as PersCollectionViewCell
        
        cell.imgImage.image = imageArroy[indexPath.row]
        
        return cell
    }*/
}

